
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>部署 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="dockerbu-shu.html" />
    
    
    <link rel="prev" href="shi-yong-shuo-ming.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="shi-yong-shuo-ming.html">
            
                <a href="shi-yong-shuo-ming.html">
            
                    
                    使用说明
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3" data-path="install.html">
            
                <a href="install.html">
            
                    
                    部署
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="dockerbu-shu.html">
            
                <a href="dockerbu-shu.html">
            
                    
                    部署(Docker)
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >部署</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x5B89;&#x88C5;&#x90E8;&#x7F72;</p>
<ul>
<li>&#x5B89;&#x88C5;MongoDB</li>
<li>&#x5B89;&#x88C5;Nodejs</li>
<li>&#x5B89;&#x88C5;pm2</li>
</ul>
<p>1.clone&#x4E0B;&#x8F7D;&#x4EE3;&#x7801;</p>
<pre><code class="lang-java"><span class="hljs-comment">//&#x8FDB;&#x5165;&#x9879;&#x76EE;&#x6839;&#x76EE;&#x5F55;</span>

npm install  <span class="hljs-comment">//&#x5B89;&#x88C5;&#x4F9D;&#x8D56;</span>

<span class="hljs-comment">//&#x914D;&#x7F6E;&#x524D;&#x7AEF;&#x63A5;&#x53E3;&#x8BF7;&#x6C42;&#x7684;baseUrl&#x548C;&#x540E;&#x7AEF;&#x8FD0;&#x884C;&#x7684;&#x7AEF;&#x53E3;&#x53F7;</span>
node app config -u https:<span class="hljs-comment">//yijian.fun -p 9898 </span>

<span class="hljs-comment">//&#x542F;&#x52A8;&#x9879;&#x76EE;</span>
node app start -i -b
</code></pre>
<p>2.&#x914D;&#x7F6E;nginx</p>
<p>&#x53EF;&#x4EE5;&#x6309;&#x7167;&#x9879;&#x76EE;&#x6839;&#x76EE;&#x5F55;&#x7684;fabu_nginx.conf&#x6587;&#x4EF6;&#x8FDB;&#x884C;&#x914D;&#x7F6E;</p>
<pre><code class="lang-bash">server{
  listen 80;
  server_name yijian.fun;

  <span class="hljs-comment">#root&#x76EE;&#x5F55;&#x4E3A;&#x9879;&#x76EE;&#x6839;&#x76EE;&#x5F55;&#x7684;client/dist&#x76EE;&#x5F55;&#x4E0B;</span>
  root /home/ubuntu/fabulove/client/dist;
  index index.html;

  location / {
      try_files <span class="hljs-variable">$uri</span> <span class="hljs-variable">$uri</span>/ @router;
      index index.html;
  }

  location /upload/ {
      <span class="hljs-comment">#&#x8BE5;&#x76EE;&#x5F55;&#x4E3A;&#x6839;&#x76EE;&#x5F55;&#x4E0B;config&#x6587;&#x4EF6;&#x91CC;&#x914D;&#x7F6E;&#x7684;&#x6587;&#x4EF6;&#x4E0A;&#x4F20;&#x76EE;&#x5F55;</span>
      <span class="hljs-comment">#&#x6216;&#x8005;&#x4F7F;&#x7528;node app config &#x914D;&#x7F6E;&#x7684;updateDir</span>
      root /home/ubuntu/fabulove/upload
      expires  30d;
  }

  location @router {
      rewrite ^.*$ /index.html last;
  }


  location /api/ {
    proxy_pass http://127.0.0.1:8383;
    proxy_<span class="hljs-built_in">set</span>_header Host <span class="hljs-variable">$host</span>;
    proxy_<span class="hljs-built_in">set</span>_header X-Forwarded-For <span class="hljs-variable">$proxy_add_x_forwarded_for</span>;
  }
  client_max_body_size 208M; 
}
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="shi-yong-shuo-ming.html" class="navigation navigation-prev " aria-label="Previous page: 使用说明">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="dockerbu-shu.html" class="navigation navigation-next " aria-label="Next page: 部署(Docker)">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"部署","level":"1.3","depth":1,"next":{"title":"部署(Docker)","level":"1.4","depth":1,"path":"dockerbu-shu.md","ref":"dockerbu-shu.md","articles":[]},"previous":{"title":"使用说明","level":"1.2","depth":1,"path":"shi-yong-shuo-ming.md","ref":"shi-yong-shuo-ming.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"install.md","mtime":"2018-05-16T09:32:08.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-05-17T03:13:26.564Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

